"use strict";
require([
    './dev/tool',
    'text!tpl/queryInfo.hbs',
    'text!tpl/addtip.hbs',
    'text!tpl/editTip.hbs',
    'text!tpl/selectTim.hbs',
    'text!tpl/upTim.hbs',
    './conf/urlObj',
    './conf/baseConfig',
    './dev/handleChart',
], function(tool, queryInfo, addtip, editTip, selectTim, upTim, urlObj, baseConfig, handleChart) {

    layui.use(['layer', 'table', 'element', 'form', 'laydate', 'upload'], () => {
        const $ = layui.jquery,
            table = layui.table,
            element = layui.element,
            layer = layui.layer,
            laydate = layui.laydate,
            upload = layui.upload,
            form = layui.form;









        // 单行操作（编辑/删除）
        // handleChart.handeTool($, form, table, 'tool(test)', '真的删除行么', 'exampleEdit', "/xcj/vegetables/listInfo", "tabConf", "/xcj/vegetables/changeFlag", "getPriceList", "vegetable")
        //工具行操作（审核提交/退回修改/批量删除/新增/复制新增）
        handleChart.toolbarPrice($, form, table, laydate, upload, 'toolbar(test)', "没有选中指定的信息", 'exampleEdit', urlObj, "/xcj/vegetables/listInfo", "tabConf", ["/xcj/vegetables/changeState", "/xcj/vegetables/changeFlag", "/xcj/vegetables/addVegetable", "/xcj/vegetables/updateVegetables", "/xcj/excel/vegetablesTemplate", "/xcj/excel/importVegetablesTemplate"], "getPriceList", "vegetable", "dataQry", selectTim, "dataUp", upTim);
        //遍历获取品种及表单默认数据。
        // handleChart.getVariety($, form, laydate, ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "demo1", "queryBox", ["选择品种", "选择市场"], queryInfo, "queryDate")
        // handleChart.getVariety($, form, laydate, ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "demo2", "censusBox", ["选择品种", "选择市场"], queryInfo, "censusDate")
        //获取后台默认数据，构建新增表单模板
        // handleChart.getVariety($, form, laydate, ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "demo4", "std", ["选择品种", "选择市场"], addtip, "")
        //获取后台默认数据，构建编辑表单模板
        // handleChart.getVariety($, form, laydate, ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "demo5", "etd", ["选择品种", "选择市场"], editTip, "")
        //查询表单(信息录入)
        // handleChart.getPriceList($, table, urlObj, "/xcj/vegetables/listInfo", "tabConf");
        //查询表单(汇总统计)
        // handleChart.getStatistisData($, table, urlObj, "/xcj/vegetables/findByStatistisData", "tabSta");
        //退出登录
        // tool.exitHandle($, "exitBtn", ["id", "bazaarIds", "token", "username"], "login.html");
        //根据表单条件查询数据（信息录入/汇总统计）
        // handleChart.submitTip($, table, form, "demo1", "/xcj/vegetables/listInfo", handleChart['getPriceList'], "tabConf", "vegetable")
        // handleChart.submitTip($, table, form, "demo2", "/xcj/vegetables/findByStatistisData", handleChart['getStatistisData'], "tabSta", "vegetable")
        //新增一条数据
        // handleChart.submitAddPrice($, table, form, "demo4", handleChart['putAddInfo'], "/xcj/vegetables/addVegetable", "tabConf", "/xcj/vegetables/listInfo", "getPriceList", "vegetable")

        //编辑一条数据
        // handleChart.submitAddPrice($, table, form, "demo5", handleChart['putEditInfo'], "/xcj/vegetables/updateVegetable", "tabConf", "/xcj/vegetables/listInfo", "getPriceList", "vegetable")
        //全选或常用
        // handleChart.checkSwitch($, form, laydate, "checkbox(c_one)", 'switch(switchTest)', "#c_all", ".checkSelt", 'checkbox', "checked", queryInfo, "getVariety", "demo1", ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "queryBox", ["选择品种", "选择市场"], "queryDate")
        //handleChart.checkSwitch($, form, laydate, "checkbox(c_one)", 'switch(switchTest)', "#c_all", ".checkSelt", 'checkbox', "checked", queryInfo, "getVariety", "demo2", ["/xcj/breed/findVegtableList", "/xcj/breed/findbazaarList"], "censusBox", ["选择品种", "选择市场"], "censusDate")

        handleChart.getUserList($, table, urlObj, "/xcj/user/findUserById", "tabUser")

    });


});